Skip to content

chore: migrate tests to Rstest#49

Merged
chenjiahan merged 5 commits into
mainfrom
agent/migrate-tests-to-rstest
Jul 10, 2026
Merged

chore: migrate tests to Rstest#49
chenjiahan merged 5 commits into
mainfrom
agent/migrate-tests-to-rstest

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

This PR migrates the E2E test runner from @playwright/test to Rstest so the repository uses the Rstack testing workflow while retaining Playwright browser automation. It adds @rstest/playwright, preserves the existing test coverage, and keeps Rsbuild's build and development modes unchanged.

Related Links

@chenjiahan chenjiahan marked this pull request as ready for review July 10, 2026 08:27
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@chenjiahan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5129057-f9c2-47e7-aa8f-10dc3412b642

📥 Commits

Reviewing files that changed from the base of the PR and between a7dc8c2 and 0f6e211.

📒 Files selected for processing (4)
  • package.json
  • rstest.config.ts
  • test/e2e.test.ts
  • test/rstest.config.ts
📝 Walkthrough

Walkthrough

Test execution was migrated to RsTest with separate unit and E2E projects. Package scripts and development dependencies were updated, the RsTest package scope was added to workspace release-age exclusions, and the Playwright test now imports its APIs from @rstest/playwright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating tests to Rstest.
Description check ✅ Passed The description is directly related to the changeset and matches the test runner migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/migrate-tests-to-rstest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/index.pw.test.ts`:
- Line 4: The test currently mixes Rstest with Playwright’s locator assertion
style. Update the assertions in the test cases to use Rstest’s
expect.element(locator) API, or replace the imports with native Playwright test
utilities if retaining toHaveText semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0ffe876-1cbe-41c2-b6c8-d58b3dce7a0e

📥 Commits

Reviewing files that changed from the base of the PR and between efb66e7 and a7dc8c2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • package.json
  • pnpm-workspace.yaml
  • test/index.pw.test.ts
  • test/playwright.config.ts
  • test/rstest.config.ts
💤 Files with no reviewable changes (1)
  • test/playwright.config.ts

Comment thread test/e2e.test.ts
@chenjiahan chenjiahan merged commit d921394 into main Jul 10, 2026
3 checks passed
@chenjiahan chenjiahan deleted the agent/migrate-tests-to-rstest branch July 10, 2026 09:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f6e2110e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rstest.config.ts
NODE_ENV: undefined,
},
retry: process.env.CI ? 3 : 0,
testTimeout: 10_000,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the e2e timeout budget

In the GitHub Actions test matrix (.github/workflows/test.yml), pnpm run test now runs test/e2e.test.ts, which starts pnpm run dev, waits for the dev server, navigates, and asserts the page. This 10s Rstest per-test cap is much lower than the previous Playwright Test default of 30s, so slower CI runs—especially Windows—can time out before the app is ready. Rstest documents testTimeout as the default test timeout (https://rstest.rs/config/test/test-timeout), while Playwright documents the previous default as 30_000ms (https://playwright.dev/docs/test-timeouts); please keep the e2e timeout at least as large as before or set it only on the e2e test.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant